<template>
  <div class="dashboard-container">
    <!-- 背景层：建筑远景图 -->
    <div class="bg-image">
      <img src="../../../public/33333.png" alt="西红市行政服务中心" />
    </div>

    <!-- 数据指标层：四个统计项 -->
    <div class="stats-group">
      <StatItem  value="66" unit="人" label="今日取号" />
      <StatItem  value="199" unit="人" label="正在受理" />
      <StatItem  value="99" unit="人" label="等待受理" />
      <StatItem  value="20" unit="分" label="平均办理时长" />
    </div>

    <!-- 悬浮窗口层：服务大厅内部图 -->
    <div class="floating-window" :style="{ top: '30%', left: '5%' }">
      <div class="window-header">
        <div class="header-dot yellow"></div>
        <div class="header-dot cyan"></div>
        <div class="header-dot cyan"></div>
      </div>
      <img src="../../../public/44444.png" alt="服务大厅内部" />
    </div>

    <!-- 关联线层：连接建筑与悬浮窗口 -->
    <div class="connection-line" :style="{ top: '30%', left: '70%' }"></div>

    <!-- 建筑标签 -->
    <div class="building-label">
      西红市行政服务中心
    </div>
  </div>
</template>

<script setup>
// 封装数据指标组件（StatItem.vue）
import StatItem from '../sandi/StatItem.vue';
</script>

<style scoped>
.dashboard-container {
  position: relative;
  width: 100%;
  height: 600px; /* 自定义高度 */
  overflow: hidden;
}

/* 背景层：建筑图 */
.bg-image {
  width: 100%;
  height: 100%;
}
.bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1px) opacity(0.8); /* 轻微模糊和透明，突出前景 */
}

/* 数据指标组：横向排列 */
.stats-group {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  z-index: 2;
  
}

/* 悬浮窗口：带边框和头部装饰 */
.floating-window {
  position: absolute;
  border: 2px solid rgba(0, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  z-index: 3;
  transition: all 0.3s ease;
}
.floating-window:hover {
  transform: scale(1.02); /* 悬停放大效果 */
}
.floating-window img {
  width: 400px;
  height: 250px;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}
.window-header {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 4px 4px 0 0;
}
.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.yellow { background-color: #ffcc00; }
.cyan { background-color: #00ffff; }

/* 关联线：从建筑到悬浮窗口 */
.connection-line {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 50%;
  transform: rotate(45deg);
  z-index: 1;
}

/* 建筑标签 */
.building-label {
  position: absolute;
  bottom: 20px;
  right: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  z-index: 2;
}
</style>